<html>
<head><meta charset="utf-8"><title>diagnostics refactoring · t-compiler/wg-diagnostics · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/index.html">t-compiler/wg-diagnostics</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/diagnostics.20refactoring.html">diagnostics refactoring</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="159326263"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/diagnostics%20refactoring/near/159326263" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/diagnostics.20refactoring.html#159326263">(Feb 25 2019 at 10:11)</a>:</h4>
<p><span class="user-mention" data-user-id="119031">@Esteban Küber</span> is there anything I can work on that would be helpful with the diagnostics refactoring discussed at the All Hands?</p>



<a name="160805014"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/diagnostics%20refactoring/near/160805014" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Esteban Küber <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/diagnostics.20refactoring.html#160805014">(Mar 14 2019 at 17:52)</a>:</h4>
<p>There are a few things that you could do, one option would be to lay the work to move <code>rustc</code> to use <a href="https://crates.io/crates/annotate-snippets" target="_blank" title="https://crates.io/crates/annotate-snippets">https://crates.io/crates/annotate-snippets</a></p>



<a name="161064212"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/diagnostics%20refactoring/near/161064212" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/diagnostics.20refactoring.html#161064212">(Mar 18 2019 at 14:56)</a>:</h4>
<p>Would a preliminary step be to create a <code>RenderDiagnostic&lt;Engine&gt;</code> trait that we can implement for structs containing all info needed for a  specific diagnostic (we can start with just a few errors and create structs for them). Then we can implement both <code>RenderDiagnostic&lt;Diagnostic&gt;</code> and <code>RenderDiagnostic&lt;annotate_snippets::Snippet&gt;</code>.</p>



<a name="161064498"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/diagnostics%20refactoring/near/161064498" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/diagnostics.20refactoring.html#161064498">(Mar 18 2019 at 14:59)</a>:</h4>
<p>I think that's a sensible approach.</p>



<a name="161064600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/diagnostics%20refactoring/near/161064600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/diagnostics.20refactoring.html#161064600">(Mar 18 2019 at 15:00)</a>:</h4>
<p>(apologies, I had it on my to-do list to reply to <span class="user-mention" data-user-id="119031">@Esteban Küber</span>'s message and think about using <code>annotate-snippets</code>)</p>



<a name="161064659"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/diagnostics%20refactoring/near/161064659" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/diagnostics.20refactoring.html#161064659">(Mar 18 2019 at 15:00)</a>:</h4>
<p>I mean, as a very small first step, you can just do the <code>RenderDiagnostic&lt;Diagnostic&gt;</code> part</p>



<a name="161064775"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/147480-t-compiler/wg-diagnostics/topic/diagnostics%20refactoring/near/161064775" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/147480-t-compiler/wg-diagnostics/topic/diagnostics.20refactoring.html#161064775">(Mar 18 2019 at 15:02)</a>:</h4>
<p>If we can start ripping diagnostics code out of the regular logic paths, that would already be a big boon</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>